/*
 * Copyright © 2017 Cask Data, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
*/

$create_rulebook_btn_font_color: #cccccc;
$rulebook_search_label_color: #333333;
$rulebook_search_label_color_hover: #f5f5f5;
$rulebook_icon_color: #999999;
$rulebook_content_bg_color: white;

.rule-books-tab {
  padding: 20px 30px;

  .rule-books-search-label {
    color: $rulebook_search_label_color;
    font-size: 16px;
  }

  .rule-books-search-group {
    margin-top: 8px;

    .input-group-addon {
      background-color: $rulebook_content_bg_color;

      .icon-search {
        color: $create_rulebook_btn_font_color;
      }
    }

    input {
      height: 35px;
    }
  }

  input {
    border-radius: 0;
  }

  .rule-books-container {
    display: flex;
    flex-wrap: wrap;

    .rule-book {
      &.center {
        display: flex;
        flex-direction: column;
        border: 0;
        justify-content: center;
        padding: 0;
        background-color: initial;

        &:only-child {
          width: 100%;
        }

        > div {
          height: 98px;
          display: flex;
          flex-direction: column;
          align-items: center;
          justify-content: center;
          border: 1px dashed $create_rulebook_btn_font_color;
          width: 100%;
          font-size: 2em;
          background-color: $rulebook_content_bg_color;

          &:first-child {
            margin-bottom: 8px;
          }

          &:hover {
            background-color: $rulebook_search_label_color_hover;
          }

          svg.icon-import,
          svg.icon-plus {
            font-size: 1em;
            margin-top: 10px;
            color: $rulebook_icon_color;
          }
          strong {
            font-size: 13px;
            color: $rulebook_search_label_color;
            text-align: center;
          }
        }
      }

      &:hover {
        &:not(.center) {
          margin: 14px 9px;
        }
      }
    }
    &.loading {
      justify-content: center;
      align-items: center;
      height: calc(100% - 31px);

      .rule-book.center {
        display: none;
      }
    }
  }

  @media (max-width: 1000px) {
    .rule-books-container {
      .rule-book {
        width: calc(100% - 20px);

        &:hover {
          &:not(.center) {
            width: calc(100% - 18px);
            margin: 14px 9px 16px;
          }
        }
      }
    }
  }

  @media (min-width: 1001px) and (max-width: 1800px) {
    .rule-books-container {
      .rule-book {
        width: calc(50% - 20px);

        &:hover {
          &:not(.center) {
            width: calc(50% - 18px);
          }
        }
      }
    }
  }

  @media (min-width: 1801px) {
    .rule-books-container {
      .rule-book {
        width: calc(33% - 20px);

        &:hover {
          &:not(.center) {
            width: calc(33% - 18px);
          }
        }
      }
    }
  }

}
